Skip to content

render context fixes - #87

Merged
IliaSidash merged 1 commit into
masterfrom
render-context-fixed-2
Jul 14, 2026
Merged

render context fixes#87
IliaSidash merged 1 commit into
masterfrom
render-context-fixed-2

Conversation

@4ok

@4ok 4ok commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses cases where render() may be called before a canvas/context is initialized by deferring the render until after _initCanvas() completes, reducing “no context” runtime errors during early lifecycle events.

Changes:

  • Add isRenderAfterInitCanvas flag to defer rendering until a canvas/context exists (ChartAreaLayer, ChartWidgetLayer).
  • Replace console.log + return 0 “no context” paths with a deferred-render flow (and silent early returns for clear()).
  • Update the bundled dist/iguanachart.js to reflect the source changes.

Reviewed changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/scripts/lib/charting/01-2-chartarealayer.js Defers overlay rendering until the canvas/context is initialized.
src/scripts/lib/charting/01-1-chartwidgetlayer.js Defers widget rendering until the canvas/context is initialized; avoids noisy console logging.
dist/iguanachart.js Built artifact updated with the same deferred-render logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +122 to +125
if (this.isRenderAfterInitCanvas) {
this.isRenderAfterInitCanvas = false;
this.render();
}
Comment on lines +934 to +937
if (this.isRenderAfterInitCanvas) {
this.isRenderAfterInitCanvas = false;
this.render();
}
@IliaSidash
IliaSidash merged commit 70ddd0e into master Jul 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants